﻿/*
 * FileName:    <##MAST_ID##>MastAction.java
 * Description: <##MAST_NAME##>
 * History:     <##TIME##>
 */
package jp.co.sn.<##PRJ_ID##>.master.<##MAST_FIELD##>.action;

import java.util.List;

import com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator;

import jp.co.sn.system.common.action.BaseAction;
import jp.co.sn.system.common.command.Page;
import jp.co.sn.<##PRJ_ID##>.pojo.<##MAST_FIELD##>.<##MAST_ID##>;


public class <##MAST_ID##>MastAction extends BaseAction {

	/** 一覧データー **/
	private Page compageData;
	
	private List<<##MAST_ID##>> <##MAST_FIELD##>List;
	
	private <##MAST_ID##> <##MAST_FIELD##>;
	
	public String execute() throws Exception {
		compageData=this.commonService.putDataToPage(this.commonService.selectAll(<##MAST_ID##>.class));
		return SUCCESS;
	}
	
	public String save() throws Exception {
		this.commonService.save(this.<##MAST_FIELD##>);
		return SUCCESS;
	}
	
	public String del() throws Exception {
		if(this.dofindObj())
		{
			this.commonService.delete(this.obj);
		}
		return SUCCESS;
	}

	public <##MAST_ID##> get<##MAST_ID##>() {
		return <##MAST_FIELD##>;
	}

	@VisitorFieldValidator(shortCircuit = true)
	public void set<##MAST_ID##>(<##MAST_ID##> <##MAST_FIELD##>) {
		this.<##MAST_FIELD##> = <##MAST_FIELD##>;
	}
	
	public Page getCompageData() {
		return compageData;
	}

	public void setCompageData(Page compageData) {
		this.compageData = compageData;
	}
}
